package com.hrs.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.hrs.enity.vo.EnumVo;
import lombok.Getter;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

/**
 * @author 计算机系 ITAEM 摆渡人
 * @description
 * @date 2022/11/20 13:59
 */
@Getter
public enum Politics {
    MEMBER_OF_COMMUNIST_PARTY_OF_CHINA(0,"中共党员"),
    PROBATIONARY_PARTY_MEMBERS(1,"中共预备党员"),
    LEAGUE_MEMBER(2,"共青团员"),
    PARTY_MEMBER_OF_THE_DEMOCRATIC_REVOLUTION(3,"民革党员"),
    MEMBER_OF_THE_DEMOCRATIC_LEAGUE(4,"民盟盟员"),
    MEMBER_OF_CIVIL_CONSTRUCTION_CORPORATION(5,"民建会员"),
    CIVIL_PROGRESS_MEMBER(6,"民进会员"),
    MEMBER_OF_THE_PEASANT_LABOR_PARTY(7,"农工党党员"),
    MEMBER_OF_THE_PUBLIC_PARTY(8,"致公党党员"),
    MEMBER_OF_JIUSAN_SOCIETY(9,"九三学社社员"),
    MEMBER_OF_THE_TAIWAN_UNION(10,"台盟盟员"),
    PERSONS_WITHOUT_PARTY_AFFILIATION(11,"无党派人士"),
    MASSES(12,"群众");

    @EnumValue
    private final Integer code;
    private final String display;

    Politics(Integer code, String display) {
        this.code = code;
        this.display = display;
    }

    public static List<EnumVo> getEnumVos() {
        List<EnumVo> enumVos = new ArrayList<>();
        EnumSet.allOf(Politics.class)
                .forEach(politics -> {
                    EnumVo enumVo = new EnumVo();
                    enumVo.setCode(politics.code);
                    enumVo.setDisplay(politics.display);
                    enumVos.add(enumVo);
                });

        return enumVos;
    }
}
